<script>
  Function.prototype.myBind = function () {
    //把参数变成数组
    let args = Array.prototype.slice.call(arguments);
    console.log(arguments);
    // console.log(args);
    // 弹出第一个参数，这个参数是this
    let t = args.shift();
    let self = this;
    return function () {
      self.apply(t, args);
    };
  };
  function fn(a, b, c) {
    console.log(this);
    console.log(a, b, c);
  }
  let a = fn.myBind({ x: 100 }, 10, 20, 30);
  //   console.log(a);
  a();
</script>
